package magicbattle.game.character.effect;

import magicbattle.game.Player;
import magicbattle.game.character.Attribute;
import magicbattle.game.character.Target;
import magicbattle.game.character.TargetType;

public class Buff extends OverTimeEffect {

	private Attribute addedAttribute;

	public Buff(EffectType effectType, TargetType targetType,
			Attribute addedAttribute, int duration) {
		super();
		this.effectType = effectType;
		this.targetType = targetType;
		this.addedAttribute = addedAttribute;
		this.duration = duration;
		this.interval = 0;
	}

	public Buff(EffectType effectType, TargetType targetType,
			Attribute addedAttribute) {
		super();
		this.effectType = effectType;
		this.targetType = targetType;
		this.addedAttribute = addedAttribute;
		this.duration = 0;
		this.interval = 0;
	}

	@Override
	public void action(Player currentPlayer, Player targetPlayer) {
		targetPlayer.addCurrentBuff(this);
	}

	@Override
	public void doInterval(Player currentPlayer) {
	}

	@Override
	public void atEnd(Player currentPlayer) {
		currentPlayer.removeCurrentBuff(this);
	}

	public Attribute getAddedAttribute() {
		return addedAttribute;
	}

}
